# 编写选项表相关业务
from rest_framework.viewsets import ModelViewSet
from rest_framework.permissions import IsAdminUser
from rest_framework.response import Response
from apps.goods.models import SpecificationOption
from apps.meiduo_admin.serializers.options import SpecificationOptionSerialzier
from apps.meiduo_admin.utils import NumPage

class OptionsView(ModelViewSet):
    # 指定序列化器
    serializer_class = SpecificationOptionSerialzier
    # 指定查询集
    queryset = SpecificationOption.objects.all()
    # 指定权限
    permission_classes = [IsAdminUser]
    # 指定分页
    pagination_class = NumPage
